#include "Environment.h"
#include "ScriptEngine.h"
#if _DEBUG
#include "Trace.h"
#endif

int WINAPI WinMain( __in HINSTANCE hInstance, __in_opt HINSTANCE hPrevInstance, __in_opt LPSTR lpCmdLine, __in int nShowCmd )
{
	#ifdef _DEBUG
	try {
	#endif
	Environment* game;
	game = new Environment();
	Environment::pushRoom(Environment::loadRoom("StartRoom.res",0));
	game->run();
	delete game;
	#ifdef _DEBUG
	} catch (luabind::error &e) {
		_trace("%s",lua_tostring(e.state(),-1));
	}
	#endif
	return 0;
}